# -*- coding: utf-8 -*-
from django.core.files.storage import FileSystemStorage
from django.http import HttpResponse


class GoodMultimediaStorage(FileSystemStorage):
    from django.conf import settings

    def __init__(self, location=settings.MEDIA_ROOT,   base_url=settings.MEDIA_URL):
        # 初始化
        super(GoodMultimediaStorage, self).__init__(location, base_url)

    # 重写 _save方法
    def _save(self, name, content):
        # name:good/multimedia/...  位于/media/下其中upload_to='good/multimedia/'
        # content
        print('name:', name)
        print('content', type(content),content)

        return super(GoodMultimediaStorage, self)._save(name, content)




